package demo3;

import demo3.Contoller.MyController;
import demo3.Repository.MyRepository;
import demo3.Service.MyService;
import demo3.pojo.Person;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Test {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context1 = new AnnotationConfigApplicationContext("demo3");
        MyController bean = context1.getBean(MyController.class);
        System.out.println(bean);
        context1.getBean(MyService.class);
        context1.getBean(MyRepository.class);
        Person bean1 = context1.getBean(Person.class);
        Person bean2=context1.getBean(Person.class);
//        System.out.println(bean1==bean2);
//        System.out.println(bean1);
//        System.out.println(bean2);
//        Singleton bean3 = context1.getBean(Singleton.class);
//        Singleton s1=Singleton.getInstance();
//        Singleton s2=Singleton.getInstance();
//        System.out.println(s1);
//        System.out.println(s2);
    }
}
